package studentwjchoi;
import java.util.ArrayList;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;


public class CourseSession {
	
	private String courseName;
	private String courseNo;
	private java.util.ArrayList<Student> students = new ArrayList<Student>();
	private Date courseStDate;
	
	public CourseSession(String cousename, String courseno){
		this.courseName = cousename;
		this.courseNo = courseno;
	}
	
	public CourseSession(String department, String number, Date startDate) {
		this.courseName = department;
		this.courseNo = number;
		this.courseStDate = startDate;
	}
	
	public String getCourseName() {
		return courseName;
	}

	public String getCourseNo() {
		return courseNo;
	}

	public int getNumberofStudent() {
		return students.size();
	}
	
	public void enroll(Student student){
		students.add(student);
	}

	public ArrayList<Student> getAllStudents() {
		return students;
	}
	
	public Student get(int index){
		return students.get(index);
	}
	
	public Date getEndDate(){
		GregorianCalendar calendar = new GregorianCalendar();
		calendar.setTime(courseStDate);
		int numberOfDays = (16 * 7) - 3;
		calendar.add(Calendar.DAY_OF_YEAR, numberOfDays);
		return calendar.getTime();
		
	}
	public Date getStartDate(){
		return courseStDate;
	}

}
